import request from '@/utils/request'

// 获取用户列表
export function getUserList(page?: number, keyword?: string) {
  let params: { page: number, keyword?: string } = {
    page: page ? page : 1
  }
  if (keyword) {
    params.keyword = keyword
  }
  return request({
    url: '/user',
    method: 'get',
    params
  })
}

// 更改用户状态
export function changeUserStatus(uid: number, status: number) {
  return request({
    url: `/user/${uid}/status/${status}`,
    method: 'patch'
  })
}